#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cstdlib>
#include<ctime>
using namespace std;
const int maxn=100010;
int num[maxn],sum=0;
template<class T>
struct Treap 
{
	int C, Top, bin[maxn];
	int L[maxn], R[maxn], P[maxn], pri[maxn], size[maxn];
	T key[maxn];
	int root;
	void init() 
	{
		srand(time(0));
		root = 0;
		C = 0;
		Top = 0;
		memset(L, 0, sizeof(L));
		memset(R, 0, sizeof(R));
		memset(P, 0, sizeof(P));
	}
	void rightRotate(int x) 
	{
		int y = L[x];
		L[x] = R[y];
		if (R[y])
			P[R[y]] = x;
		P[y] = P[x];
		if (!P[x])
			root = y;
		else if (x == L[P[x]])
			L[P[x]] = y;
		else
			R[P[x]] = y;
		R[y] = x;
		P[x] = y;
	}
	void leftRotate(int x) 
	{
		int y = R[x];
		R[x] = L[y];
		if (L[y])
			P[L[y]] = x;
		P[y] = P[x];
		if (!P[x])
			root = y;
		else if (x == L[P[x]])	
			L[P[x]] = y;
		else
			R[P[x]] = y;
		L[y] = x;
		P[x] = y;
	}
	int min(int x) 
	{
		while (L[x])
			x = L[x];
		return x;
	}
	int max(int x) 
	{
		while (R[x])
			x = R[x];
		return x;
	}
	int next(int x) 
	{
		if (R[x])
			return min(R[x]);
		int y = P[x];
		while (y && x == R[y]) {
			x = y;
			y = P[y];
		}
		return y;
	}
	int pre(int x) 
	{
		if (L[x])
			return max(L[x]);
		int y = P[x];
		while (y && x == L[y]) 
		{
			x = y;
			y = P[y];
		}
		return y;
	}
	void makeSize(int x) 
	{
		if (!L[x] && !R[x])
			size[x] = 1;
		else 
		{
			if (L[x])
				makeSize(L[x]);
			if (R[x])
				makeSize(R[x]);
			size[x] = 1;
			if (L[x])
				size[x] += size[L[x]];
			if (R[x])
				size[x] += size[R[x]];
		}
	}
	void keepSize(int x) 
	{
		while (x) 
		{
			size[x] = 1;
			if (L[x])
				size[x] += size[L[x]];
			if (R[x])
				size[x] += size[R[x]];
			x = P[x];
		}
	}
	int insert(T k) 
	{
		int z;
		if (Top) 
		{
			z = bin[--Top];
		}
		else
		{
			z = ++C;
			pri[z] = rand();
		}
		L[z] = R[z] = P[z] = 0;
		key[z] = k;
		num[z]=1;
		int x = root, y = 0;
		while (x) 
		{
			y = x;
			if (k < key[x])
				x = L[x];
			else
				x = R[x];
		}
		P[z] = y;
		if (!y)
			root = z;
		else if (k < key[y])
			L[y] = z;
		else
			R[y] = z;
		while (P[z] && pri[z] < pri[P[z]]) 
		{
			if (z == L[P[z]])
				rightRotate(P[z]);
			else
				leftRotate(P[z]);
		}
		if (!P[z])
			root = z;
		makeSize(z);
		keepSize(P[z]);
		return z;
	}
	void del(int z) 
	{
		int x, y;
		if (!L[z] || !R[z])
			y = z;
		else
			y = next(z);
		if (L[y])
			x = L[y];
		else
			x = R[y];
		if (x)
			P[x] = P[y];
		if (!P[y])
			root = x;
		else if (y == L[P[y]])
			L[P[y]] = x;
		else
			R[P[y]] = x;
		if (y != z)
			key[z] = key[y];
		keepSize(P[y]);
		bin[Top++] = y;
	}
	int search(T& k) 
	{
		int x = root;
		while (x && !(key[x] == k)) 
		{
			if (k < key[x])
				x = L[x];
			else
				x = R[x];			
		}
		return x;
	}
	int select(int x, int i) 
	{
		if (!x)
			return 0;
		int r = size[L[x]] + 1;
		if (i == r)
			return x;
		else if (i < r)
			return select(L[x], i);
		else
			return select(R[x], i - r);
	}
	int select(int i)
	{return select(root, i);}
	int rank(int x) 
	{
		int r = size[L[x]] + 1;
		int y = x;
		while (y != root) 
		{
			if (y == R[P[y]])
				r += size[L[P[y]]] + 1;
			y = P[y];
		}
		return r;
	}
	T& operator[](int i) 
	{return key[i];}
	void walk(int k)
	{
		if(k!=0)
		{
			walk(L[k]);
			cout<<key[k];
			printf(" %0.4lf\n",100.0*num[k]/(double)sum);
			walk(R[k]);
		}
	}

};
int main()
{
	Treap<string>treap;
	treap.init();
	string str;
	while(getline(cin,str))
	{
		sum++;
		int x=treap.search(str);
		if(x!=0)num[x]++;
		else treap.insert(str);
	}
	treap.walk(treap.root);
	return 0;
}

			
			


